var inEle = document.querySelectorAll('input')
var btn = document.querySelector('button')

btn.onclick = () => {
    axios.post('/user/login', { phone: inEle[0].value, pass: inEle[1].value }).then((res) => {
        if (res.data.code==200) {
            localStorage.setItem('token', res.data.token)
            localStorage.setItem('userinfo', JSON.stringify(res.data.userinfo))
            alert('登录成功')
            location.href = './index.html'
        } else {
            alert('登陆失败')
        }
    })
}